<template>
  <div class="nav">
    <div class="wrap nav-wrap">
      <div class="l">
        <h1>
          <img src="../assets/img/indexLogo.6f8ac4f0.png" alt="" />
        </h1>
      </div>
      <div class="c">
        <ul>
          <router-link tag="li" to="/shouye">首页</router-link>
          <router-link tag="li" to="/allshop">全部商品</router-link>
          <router-link tag="li" to="/people">个人中心</router-link>
          <router-link tag="li" to="/dingdan">我的订单</router-link>
          <router-link tag="li" to="/fuli">专属福利</router-link>
        </ul>
      </div>
      <div class="r">
        <input type="text" placeholder="请输入" v-model="keyword"/>
        <span class="search-btn" @click="sreach"><img src="../assets/img/search.png" alt=""/></span>
      </div>
    </div>
  </div>
</template>

<script>
import {cartsouAPI} from '@/request/api'
export default {
  data() {
    return {
		keyword:''
	};
  },
  methods:{		  
	  sreach(){
		  //携带关键字到allshop搜索
		  this.$router.push(`/allshop?keyword=${this.keyword}`)
	  },
  }
};
</script>
 
<style lang = "less" scoped>
.nav-wrap {
  height: 118px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .c ul {
    width: 500px;
    display: flex;
    justify-content: space-between;
    li{
      cursor: pointer;
    }
  }
  .r {
    display: flex;
    input {
      width: 214px;
      height: 40px;
      border: 1px solid #dedede;
      border-radius: 20px 0 0 20px;
      float: left;
      box-sizing: border-box;
      padding-left: 19px;
      outline-style: none;
    }
    .search-btn {
      width: 50px;
      height: 40px;
      background: #0a328e;
      border-radius: 0px 20px 20px 0px;
      text-align: center;
      line-height: 44px;
    }
  }
}
.router-link-active{
	color: #0a328e;
}
</style>